//点击登陸
var do_login_url = web_url + '/owner/user/do-login'+'.html',
    job_list_url = web_url + '/home/job/index'+'.html';
$('input').focus(function(evnet){
    $('.login_info').hide();
})  
$(".login-btn").click(function(event){
    var e = window.event || event,
       errNum = 0;
    if(e.preventDefault){
        e.preventDefault();
    }else{
        window.event.returnValue = false; 
    }

    //触发验证
    $('input').trigger('blur');
    errNum = $('span.warning:visible').length;

    if( errNum == 0) {

        $.ajax({
            async : false,
            url   : do_login_url,
            type  : 'post',
            data  : {'mobile':$('input[name="mobile"]').val(),'password': $('input[name="password"]').val()},
            dataType :'json',
            success:function(data){
                if(data.code == 400){
                    $('.login_info').show().find('span.warning').show();

                }else{
                    location.href = job_list_url;                    
                }
            }
        })
    }
})
